import React from 'react';
import AirData from './common/AirData';
import Dehumidifier from './common/Dehumidifier';
import FireMain from './common/FireMain';
import FireProtection from './common/FireProtection';
import LiquidCooling from './common/LiquidCooling';
import LiquidLeakageDetection from './common/LiquidLeakageDetection';

interface props {
  tabIndex?: string;
  deviceCode?: string;
}

const Index: React.FC<props> = ({ tabIndex, deviceCode }) => {
  return (
    <>
      {tabIndex === 'AIR_COOL' && <AirData deviceCode={deviceCode} />}
      {tabIndex === 'LIQUID_COOL' && <LiquidCooling deviceCode={deviceCode} />}
      {tabIndex === 'DEHUMIDITY' && <Dehumidifier deviceCode={deviceCode} />}
      {tabIndex === 'LEAK_DETECTOR' && <LiquidLeakageDetection deviceCode={deviceCode} />}
      {tabIndex === 'FIRE_DETECTOR' && <FireProtection deviceCode={deviceCode} />}
      {tabIndex === 'FIRE_HOST' && <FireMain deviceCode={deviceCode} />}
    </>
  );
};

export default Index;
